package com.jrx.anytxn.transaction.job.dailyAccount.step;

import com.jrx.anytxn.transaction.constant.TransBizConstant;
import com.jrx.anytxn.transaction.entity.TlDailyAccountLog;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.HashMap;
import java.util.Map;

/**
 * 读取记账状态未知明细数据
 *
 * @Author yhy
 * @Date 2023/4/29 15:00
 */
public class DailyAccountStatusUpdateReader extends MyBatisPagingItemReader<TlDailyAccountLog> {

    /**
     * 读取记账状态未知明细数据
     *
     * @param sqlSessionFactory sql工厂对象
     * @param pagesize 分页参数
     */
    public DailyAccountStatusUpdateReader(SqlSessionFactory sqlSessionFactory, Integer pagesize) {
        setSaveState(false);
        setPageSize(pagesize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtTlDailyAccountLogMapper.selectByStatus");

        Map<String, Object> map = new HashMap<>();
        // 日终T24核心汇总记账明细状态
        map.put("returnStatus", TransBizConstant.DISBURSEMENT_LOG_SUM_STATUS_O);
        setParameterValues(map);
    }
}
